function x_imgswap(inme, isrc) { x_swapImage(inme, "", isrc, 1); }
function x_imgrest() { x_swapImgRestore(); }
function x_swapImgRestore() { var i,x,a=document.x_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; }
function x_preloadImages() { var d=document; if(d.images){ if(!d.x_p) d.x_p=new Array(); var i,j=d.x_p.length,a=x_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.x_p[j]=new Image; d.x_p[j++].src=a[i];}}}
function x_findObj(n, d) { var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=x_findObj(n,d.layers[i].document); return x;}
function x_swapImage() { var i,j=0,x,a=x_swapImage.arguments; document.x_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=x_findObj(a[i]))!=null){document.x_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} }

function x_onFormPress(e) {
	var keycode;
	if (window.event) 
		keycode = window.event.keyCode;
	else if (e) 
		keycode = e.which;
	else 
		return true;
	if (keycode == 13)
		x_frm.Check(this, false);
	return true 
}

function x_onRightPress(e) {
	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
		return false;
	else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
		alert("Sorry, this content has copyright restrictions.");
		return false;
		}
	return true;
}

function x_goto_link(it) { if (it != "") document.location.href = "x_portal.asp?link=" + it; }
function x_goto_url(it) { 
	if (it == "top")
		document.location.href = "#topofpage";
	else if (it != "") 
		document.location.href = it;
}
function TextEditDecode(text) {
	text = text.replace(/&quot;/g, "'") ;
	text = text.replace(/&lt;/g, "<") ;
	text = text.replace(/&gt;/g, ">") ;
	text = text.replace(/<br \/>/g, "\n") ;
	return text ;
}
